using System;
using System.IO;
using Microsoft.Xna.Framework.Content.Pipeline;
using Scurvy.Media.VideoModel;

namespace Scurvy.Media.Pipeline.Video.Avi
{
    /// <summary>
    /// Imports an AVI Video
    /// </summary>
    [ContentImporter(".avi",
       CacheImportedData = false,
       DefaultProcessor = "VidProcesor",
       DisplayName = "Avi Video - Scurvy Media")]
    public class AviVidImporter : VidImporter
    {
        public override IVideoContent Import(string filename, ContentImporterContext context)
        {
            FileInfo info = new FileInfo(filename);
            if (info.IsReadOnly)
            {
                throw new InvalidVideoContentException(Path.GetFileName(filename) + " is readonly.  Video must be writable.");
            }
            AviVideoContent aviContent = new AviVideoContent(filename);

            return aviContent;
        }
    }
}
